package org.tloss;

public abstract class AbstractMonster implements Monster {
	int type;
	public Location getLocation() {
		return location;
	}

	public int getType() {
		return 0;
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = -6891131356811239050L;
	protected Location location;

	public void setLocation(Location location) {
		this.location = location;

	}

	public Object clone() throws CloneNotSupportedException {
		return super.clone();
	}

	public boolean catchMan(Status status) {
		return location.equals(status.getManLocation());
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((location == null) ? 0 : location.hashCode());
		result = prime * result + type;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AbstractMonster other = (AbstractMonster) obj;
		if (location == null) {
			if (other.location != null)
				return false;
		} else if (!location.equals(other.location))
			return false;
		if (type != other.type)
			return false;
		return true;
	}
}
